package zl.jmail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * @author  SuperZL 
 * @version 2012-9-3 上午10:25:21
 * 用户信息验证类、继承自Authenticator
 */
public class MyAuthenticator extends Authenticator{
	
	private String name;	//用户名
	private String pwd;		//密码
	
	public MyAuthenticator(){}
	public MyAuthenticator(String name,String pwd){
		this.name = name;
		this.pwd = pwd;
	}
	
	//必须覆写的方法。此方法有系统调用。验证用户信息
	protected PasswordAuthentication getPasswordAuthentication(){
		return new PasswordAuthentication(name, pwd);
	}

}
